
const qs = require('querystring')

let str = ''

exports.handleData = (req, res, next) => {
    req.on('data', (data) => {
        str += data
    })
    req.on('end', () => {
        req.body = qs.parse(str)
        next()
    })
}